import request from "@/router/axios"

// get格式，application/json， 传数据格式： data: xx
// get格式，application/x-www-form-urlencoded， 传数据格式： params: xx
// post格式，application/json， 传数据格式： data: xx
// post格式，application/x-www-form-urlencoded， 传数据格式： params: xx

// get格式，application/x-www-form-urlencoded
export const getList = (current, size, params) => {
  return request({
    url: "/api/blade-desk/notice/page",
    method: "get",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    params: {
      ...params,
      current,
      size,
    },
  })
}

// get格式，application/x-www-form-urlencoded ----data简写
export const fireStation = (params) => {
  return request({
    url: "/api/bigScreen/rescueOverview/fireStation/page",
    method: "get",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    params,
  })
}

// post格式，application/json
export const saveGraph = (data) => {
  return request({
    url: "/api/info/saveGraph",
    method: "post",
    headers: {
      "Content-Type": "application/json",
    },
    data
  })
}

// post格式，application/x-www-form-urlencoded，
export const unitOutdoorHydrantRemove = (data) => {
  return request({
    url: `/api/unitOutdoorHydrant/remove`,
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    params: data,
  })
}

// 模板下载
export const deviceTemplateDownload= () => {
  return request({
    url: "/api/fireDevice/fireDeviceTempDownload",
    method: "get",
    responseType:'blob',
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    }
  })
}

// 导入 
export const deviceImport = (data) => {
  return request({
    url: "/api/fireDevice/importDevice",
    method: "post",
    headers: {
      'Content-Type': 'multipart/form-data',
    },
    data
  })
}
